import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: {
      title: '首页'
    },
    component: Home
  },
  {
    path: '/componentDemo',
    name: 'layout',
    meta: {
      title: '布局'
    },
    component: () => import(/* webpackChunkName: "layout" */ '../layout/layout.vue'),
    children: [
      {
        path: 'dialog',
        name: 'Dialog',
        meta: {
          title: 'diaolog弹层'
        },
        component: () => import(/* webpackChunkName: "dialog" */ '../views/Dialog.vue')
      },
      {
        path: 'messageBox',
        name: 'messageBox',
        meta: {
          title: 'messageBox弹窗'
        },
        component: () => import(/* webpackChunkName: "MessageBox" */ '../views/Message.vue')
      },
      {
        path: 'toast',
        name: 'toast',
        meta: {
          title: 'Toast轻提示'
        },
        component: () => import(/* webpackChunkName: "toast" */ '../views/Toast.vue')
      },
      {
        path: 'loading',
        name: 'loading',
        meta: {
          title: 'loading'
        },
        component: () => import(/* webpackChunkName: "loading" */ '../views/loading.vue')
      },
      {
        path: 'areaSelector',
        name: 'areaSelector',
        meta: {
          title: 'areaSelector'
        },
        component: () => import(/* webpackChunkName: "areaSelector" */ '../views/AreaSelector.vue')
      },
      {
        path: 'datetimePicker',
        name: 'datetimePicker',
        meta: {
          title: 'datetimePicker'
        },
        component: () => import(/* webpackChunkName: "datetimePicker" */ '../views/DatetimePicker.vue')
      },
      {
        path: 'Validatir',
        name: 'Validatir',
        meta: {
          title: 'Validatir'
        },
        component: () => import(/* webpackChunkName: "Validatir" */ '../views/Validatir.vue')
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
